Skip to content

fix(scripts): the ADR-0087 gate's own header stops hand-enumerating CATEGORIES - #16214

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-15915-adr-0087-header-marker-list
Sep 6, 2026
Merged

fix(scripts): the ADR-0087 gate's own header stops hand-enumerating CATEGORIES#16214
baozhoutao merged 1 commit into
mainfrom
claude/issue-15915-adr-0087-header-marker-list

Conversation

@claude

@claude claude Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Fixes #15915

What changed

check-adr-0087-registration.mjs's header docblock hand-enumerated the five not-required (<category> ...) marker forms plus registered, and omitted type-surface-only -- the sixth. Per the #14378 precedent for this exact defect class, the enumeration is deleted, not patched:

-  <!-- adr-0087: registered <id>[, <id>...] -->
-  <!-- adr-0087: not-required (unpublished) <why> -->
-  <!-- adr-0087: not-required (already-registered <id>[, <id>...]) <why> -->
-  <!-- adr-0087: not-required (no-migration-prescription) <why> -->
-  <!-- adr-0087: not-required (runtime-interface-only <path>#<Symbol>[, ...]) <why> -->
+  <!-- adr-0087: registered <id>[, <id>...] -->
+  <!-- adr-0087: not-required (<category> ...) <why> -->
+
+ `<category>` is one of `CATEGORIES` below -- not enumerated here...

The header now shows the marker grammar once, generically, and points readers at export const CATEGORIES (already pinned against ADR-0087's addendum in both directions, #8299) instead of restating its members. A restatement that must be kept in step with a real list is the same defect twice over -- adding a category updates the const and the ADR, and the header would still drift, forever, no matter how many members exist.

The prose at :2274 ("The sixth category: type-surface-only") already agreed with reality; only the header disagreed. It is left as-is (historical, not a running count) and is now consistent with the header, which no longer asserts a count of its own.

Anti-drift pin

Added one self-test battery, H1 (#15915), that reads the gate's own source at self-test time and refuses if the header ever names a CATEGORIES member again as (name inside the rule section. Reverse-verified by hand before commit:

  • Mutated the header back to include a not-required (type-surface-only ...) line → --self-test went red with the H1 message naming the exact category.
  • Restored → --self-test green again, byte-identical to the pre-mutation file (diffed).

SELF_TEST_BATTERIES gained the H1 entry (floor 7: 1 anchor-sanity assert + 1 generic-line assert + 5 CATEGORIES members) and SELF_TEST_BATTERY_FLOOR moved 49 → 50.

Why the file's own #8299 pin couldn't see this (context, not new work)

assertInputs pins CATEGORIES against ADR-0087's addendum in both directions, so the const and the ADR cannot disagree. The header prose was a third, unchecked copy of the same set -- invisible to that pin by construction, since the pin only ever compares the const and the ADR to each other. This PR does not touch that pin; it removes the third copy instead of teaching the pin to read a fourth thing.

Scope

File surface is exactly scripts/check-adr-0087-registration.mjs (header docblock + its own self-test, for the new pin). No other file touched. No changeset: this script ships nothing under packages/** -- skip-changeset applied.

The optional sweep triage suggested ("how many other gate headers under scripts/** restate their own consts") was not run: a trustworthy positively-controlled measurement of that shape needs its own designed grep, and a low-confidence number would be worse than none. Left for a separate finding if someone wants to build that measurement.

Tests

  • node scripts/check-adr-0087-registration.mjs --self-test -- green, 332 assertions (up from 325 pre-change; H1 added 7).
  • node scripts/check-adr-0087-registration.mjs --base origin/main -- green (this PR adds no declared-breaking changeset).
  • node scripts/check-scripts-symbol-anchors.mjs (+ --self-test) -- green, no anchor pins this file's line numbers.
  • node scripts/check-declaration-mirrors.mjs (+ --self-test) -- green (unrelated to this file; this file has no .d.mts mirror).
  • Full PM-derived gate list for this diff (node scripts/pm/dispatch-gates.mjs --commands, re-derived after rebasing onto fresh origin/main) -- all 34 commands run, all green. check:pm-dispatch-gates run under the shared verify lock (OS_VERIFY_LOCK_SLOT=issue-15915).
  • Reverse-verification of the new H1 pin: on-disk mutation → red → restore → green (see above; byte-diffed clean).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8


Generated by Claude Code

…ATEGORIES

`check-adr-0087-registration.mjs`'s header docblock listed five disposition
marker forms and omitted `type-surface-only`, the sixth -- a third,
unchecked copy of the same set the file already pins against ADR-0087 in
both directions (#8299). Per the #14378 precedent for this exact defect
class, the enumeration is deleted rather than patched: the header now shows
the marker grammar once, generically, and points at `CATEGORIES` for the
actual vocabulary, so it cannot drift again the way it just did.

Adds one self-test battery (H1) that reads the gate's own source and
refuses if the header ever names a `CATEGORIES` member again -- reverse-
verified: it goes red when the old enumeration shape is reintroduced, and
green once removed.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vbw3RPgdtqesx4azk9SbW8
@claude claude Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Sep 6, 2026
@github-actions github-actions Bot added the size/s label Sep 6, 2026
@baozhoutao
baozhoutao marked this pull request as ready for review September 6, 2026 06:29
@baozhoutao
baozhoutao enabled auto-merge September 6, 2026 06:29
@baozhoutao
baozhoutao added this pull request to the merge queue Sep 6, 2026
Merged via the queue into main with commit 0c3eaf5 Sep 6, 2026
36 checks passed
@baozhoutao
baozhoutao deleted the claude/issue-15915-adr-0087-header-marker-list branch September 6, 2026 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants